<template>
  <div class="recruitStudents" :style="screenHeight">
    <div v-if="leng === 0">
			<div class="noDataImage">
        <img src="~/static/nothing/empty_meiyoushuju.png" alt="">
        <div class="describe">抱歉，这个页面暂无数据~</div>
      </div>
		</div>
    <div class="recruitList" v-else>
      <!-- <h2>{{schoolNames}}的招生章程</h2>
      <div class="catalogStr" v-html="catalogStr"></div> -->
      <div class="listBox">
        <div @click="goDetail(item.moment_id)" class="list flex-h" v-for="item in recruitList" :key="item.moment_id">
          <i></i><b class="flex1">{{item.title}}</b>
        </div>
      </div>
    </div>


  </div>
</template>

<script>
import { getobjmoments, getMomentsList } from '~/api/school'
import { profile } from '~/api/colleges'
import ls from 'store2'
export default {
  name: 'recruitStudents',
  components: {
  },
  props:{
    schoolNames:String
  },
  directives: {
  },
  data() {
    return {
      catalogStr:'',
      screenHeight: '',
      recruitList: [],
      hasData: false,
      newsDetail: {},
      showPopup: false,
      leng:1
    }
  },
  mounted() {
    // this.getprofile()
    this.getMomentsList()
  },
  methods: {
    getMomentsList() {
      getMomentsList(this.commonJs.GetUrlParam('academyCode')).then(res=>{
        this.recruitList = res.data
        this.leng = res.data.length
      })
    },
    // getprofile() {
		// 	profile({
		// 		"academyCode": this.commonJs.GetUrlParam('academyCode'),
		// 		"fromUser": ls.get('yxkData').userId
		// 	}).then(res => {
		// 		if (res.code === '0') {
		// 			if (res.data) {	
		// 					this.catalogStr = res.data.catalog
		// 			}
		// 			if (res.data.video !== '') {
		// 					this.videos = 2;
		// 			}
		// 		  this.$hideLoading();
		// 		}
		// 	}).catch((error) => {
		// 			this.$hideLoading();
		// 	})
		// },
    handleShowNewsDetail(data) {
      this.newsDetail = data;
      this.showPopup = true;
    },
    goDetail(id) {
      this.$router.push({
				path: './recruitDetail?id=' + id
			})
    }
  }
}
</script>

<style lang="less" scoped>
  .recruitStudents {
    width: 7.5rem;
    height: auto;
    // min-height: 100vh;
		background: #fff;
    padding-top: 0.2rem;
    padding-bottom: 2rem;
    .recruitList {
      padding: 0 0.32rem 1.75rem;
      h2{
        font-size: 0.3rem;
        text-align: center;
        line-height: 0.4rem;
        margin-top: 0.3rem;
        margin-bottom: 0.3rem;
        padding: 0 0.3rem;
        box-sizing: border-box;
        font-weight: 600;
        display: block;
      }

      .singleItem {
        width: 100%;
        height: 1.2rem;
        border-bottom: 1px solid #E5E8ED;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        color: #222;
        font-size: 0.28rem;
      }
      .singleItem::before {
        content: '';
        display: inline-block;
        width: 0.1rem;
        height: 0.1rem;
        border-radius: 50%;
        background: @mainColor;
        margin-right: 0.19rem;
      }
      .listBox{
        .list{
          padding: 0.15rem 0;
          border-bottom:1px solid rgba(229,232,237,1);
          align-items: baseline;
          i{
            display: inline-block;
            width: 0.1rem;
            height: 0.1rem;
            border-radius: 50%;
            background: #FFD63D;
            vertical-align: middle;
          }
          b{
            font-size:0.28rem;
            font-weight:400;
            color:rgba(34,34,34,1);
            margin-left: 0.1rem;
            vertical-align: middle;
          }
        }
      }
    }
    .noDataImage {
      padding-top: 0.2rem;
      text-align: center;
      img {
        width: 2.4rem;
        height: 2.4rem;
        margin-bottom: 0.24rem;
      }
      .describe {
        color: #999;
        font-size: 0.28rem;
        line-height: 0.4rem;
      }
    }
  }
  .outDivdes {
		width: 100%;
		height: 100vh;
    background: #fff;
    .backToPer {
			padding: 0 0.32rem;
			width: 100%;
			height: 0.88rem;
			line-height: 0.88rem;
			text-align: left;
			overflow: hidden;
			.imgIcon {
				display: inline-block;
				width: 0.4rem;
				height: 0.4rem;
        margin-bottom: 0.2rem;
    background: url('~@/static/sprite/icon_sprites_40.png') -0.1rem -0.1rem;
    background-size:3rem 2.4rem; 
			}
    }
    .mainsss {
			padding: 0 0.32rem;
			width: 100%;

      .title {
				margin-top: 0.08rem;
				padding-bottom: 0.34rem;
				border-bottom: 1px solid #E5E8ED;

				h2 {
					margin-bottom: 0.4rem;
					color: #222;
					font-size: 0.4rem;
					font-weight: bold;
					line-height: 0.64rem;
				}

				p {
					color: #BBB;
					font-size: 0.26rem;
					line-height: 0.3rem;
				}
			}

			.content {
				margin-top: 0.32rem;
				width: 100%;

				overflow: hidden;
				/deep/p {
					display: block;
					width: 100%;
					height: auto;
					font-size: 0.3rem;

					/deeep/img {
						display: block;
						width: auto;
						max-width: 6.9rem;
						
						height: auto;
						margin: 0 auto;
						
					}
        }
        /deep/ h2 {
          font-size: 0.34rem;
          font-weight: bold;
        }

			}
		}
  }  
</style>
